﻿<%@ Page Language="C#" MasterPageFile="~/GestorEventos.Master" AutoEventWireup="true" CodeBehind="search.aspx.cs" Inherits="GestorEventos.WebForm4" Title="Untitled Page" %>
<%@ Import Namespace="Business" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="UserArea" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Main" runat="server">
<% if (Request.QueryString["type"] != null && Request.QueryString["text"] != null) {
       String type = Request.QueryString["type"].ToString();
       String text = Request.QueryString["text"].ToString();

       if (text.Equals("Artista"))
       {%>
    <table>
    <%  ListaArtista business = new ListaArtista();
    ListaArtista listaArtistas = new ListaArtista(business.getListaArtista(-10));

    for (int i = 0; i < listaArtistas.getListaArtistas().Count; i++) { 
        
    %>
        <tr>
            <td>
                <asp:Label ID="LabelNome" runat="server"></asp:Label>
                <% LabelNome.Text = listaArtistas.getListaArtistas()[i].getNomeArtista(); %>
            </td>
            <td>
            <asp:HyperLink ID="HyperLink" runat="server"></asp:HyperLink>
            <%  HyperLink.Text = "Consultar";
                HyperLink.NavigateUrl = "viewArtista.aspx?artistID=" + listaArtistas.getListaArtistas()[i].getIDArtista() + ""; %>            
            </td>
            
            <td>
                <asp:Label ID="LabelStatus" runat="server"></asp:Label>
            <%  switch (listaArtistas.getListaArtistas()[i].getStatusArtista()) {
                    case 0: LabelStatus.Text = "Para revisão";
                        break;
                    case 1: LabelStatus.Text = "Aprovado";
                        break;
                    case 2: LabelStatus.Text = "Removido";
                        break;
                }%>
            </td>
        </tr>        
    <% }  %>
     
</table>
      <%     
       }
       else if (text.Equals("Evento"))
       {
           ListaEvento business = new ListaEvento();
           ListaEvento listaEvento = 
               
               business.getSearchListaArtista(text);
       }
       else if (text.Equals("Palco"))
       {

       }
       
   }
    
    
     %>

</asp:Content>
